package com.snifferx.managedbeans;

import java.io.Serializable;
import java.util.Map;

import javax.faces.application.Application;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;


@ManagedBean(name = "navigationControlBean")
@SessionScoped
public class NavigationControlBean implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1265836494260450313L;
	private String selectTab;
	@SuppressWarnings("rawtypes")
	public String doSelectTab() {
		FacesContext context = FacesContext.getCurrentInstance();
		Map requestMap = context.getExternalContext().getRequestParameterMap();
		String selectedTab = (String) requestMap.get("selectedTab");
		selectTab = selectedTab;
		String returnvalue = "";
		if (selectTab.equals("java")) {
			  returnvalue = "/login?faces-redirect=true";
			}
		return returnvalue;
	}
	public String getSelectTab() {
		return selectTab;
	}
	public void setSelectTab(String selectTab) {
		this.selectTab = selectTab;
	}
}
